package classes.view.component
{
	import flash.display.Sprite;
	import flash.text.TextField;
	
	public class WaitingPeople_icon extends Sprite
	{
		private var _num_A:TextField;
		private var _num_B:TextField;
		private var _bg_A:Sprite;
		private var _bg_B:Sprite;
		private var _king:Sprite;
		private var _ready_A:Sprite;
		private var _ready_B:Sprite;
		
		public function WaitingPeople_icon()
		{
			super();
			setLayOut();
		}
		
		private function setLayOut():void
		{
			this._num_A 		= this.getChildByName('num_txt_A')	as TextField;
			this._num_B 		= this.getChildByName('num_txt_B')	as TextField;
			this._bg_A 			= this.getChildByName('bg_a')		as Sprite;
			this._bg_B 			= this.getChildByName('bg_a')		as Sprite;
			this._king 			= this.getChildByName('king_mc')	as Sprite;
			this._ready_A 		= this.getChildByName('ready_a')	as Sprite;
			this._ready_B 		= this.getChildByName('ready_b')	as Sprite;
		}
		
		public function set num_people($param:int):void
		{
			this._num_A.text = String($param+1);
			this._num_B.text = String($param+1);
		}
		
		public function set stateIcon($param:int):void
		{
			switch($param){
				case 0:
					//king
					this._num_A.visible 	= true;
					this._num_B.visible 	= false;
					this._bg_A.visible 		= true;
					this._bg_B.visible		= false;
					this._king.visible 		= true;
					this._ready_A.visible 	= false;
					this._ready_B.visible 	= false;
					break;
				case 1:
					//ready on
					this._num_A.visible 	= false;
					this._num_B.visible 	= true;
					this._bg_A.visible 		= false;
					this._bg_B.visible		= true;
					this._king.visible 		= false;
					this._ready_A.visible 	= true;
					this._ready_B.visible 	= false;
					break;
				case 2:
					////ready off
					this._num_A.visible 	= true;
					this._num_B.visible 	= false;
					this._bg_A.visible 		= true;
					this._bg_B.visible		= false;
					this._king.visible 		= false;
					this._ready_A.visible 	= false;
					this._ready_B.visible 	= true;
					break;
			}
		}
		
	}
}